package com.notes.algo.sx;

public class Solution2 {
	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		String dicStrI = sc.nextLine();
		java.util.List<String> res = compress(dicStrI);
		for(String r : res) {
			System.out.println(r);
		}

		String dicStr = unCompress(res);
		System.out.println(dicStr);

	}

	public static java.util.List<String> compress (String dicStr) {
		java.util.List<String> res = new java.util.ArrayList<String>();

		int hisWin;
		int preReadWin;

		int len = dicStr.length();
		for (int i = 0; i < len; i ++) {
			hisWin = i;
			if (hisWin + i < len) {
				preReadWin = hisWin;
			} else {
				preReadWin = len - i;
			}

			String hisStr = dicStr.substring(i - hisWin, i);
			String preReadStr = dicStr.substring(i, i + preReadWin);

			String ms = "";
			while (true) {
				if (preReadWin <= 0) {
					break;
				}

				String tms = preReadStr.substring(0, preReadWin);
				if (hisStr.contains(tms)) {
					ms = tms;
					break;
				}

				preReadWin --;
				if (preReadWin <= 0) {
					break;
				}
			}

			if (!"".equals(ms)) {
				int mi = hisStr.lastIndexOf(ms);
				int ml = ms.length();
				int hl = hisStr.length();
				int prl = preReadStr.length();
				if (ml < prl) {
					char nc = dicStr.charAt(i + ml);
					res.add("(" + (hl - mi) + "," + ml + "," + nc + ")");
					i += preReadWin;
				} else {
					res.add("(" + (hl - mi) + "," + ml + ", )");
					break;
				}
			} else {
				char nc = dicStr.charAt(i);
				res.add("(0,0," + nc + ")");
			}
		}

		return res;
	}

	public static String unCompress (java.util.List<String> res) {
		String dicStr = "";

		return dicStr;
	}
}
